//
// Created by yunnan xu on 2020/11/18.
//

#ifndef ANDROIDGRAPHICSDEMOS_VERTEXATTRIB_H
#define ANDROIDGRAPHICSDEMOS_VERTEXATTRIB_H

#include <iostream>
#include <gles3/gl32.h>

/*
 *  这里面顶点属性的定义，参考：https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-semantics
 *
 * */

enum class VertexAttribType
{
    POSITION_F3,
    COLOR_B10_B10_B10,
    NORMAL_F3,
    UV1_F2,
    UV2_F2,
    TANGENT_F3,
    BTANGENT_F3,
    BONE1_I4,
    WEIGHT1_F4,
    Count,
};

// 这个顶点属性有多少个分量，例如Position有3个分量，UV有2个分量，骨骼index在本引擎中有4个分量
extern GLint GLESVertexAttribToCount[];

// 这个顶点属性的一个分量有多少个字节，例如float有4个字节
extern GLint GLESVertexAttribToSize[];

// 单独一个分量的属性是什么类型的
extern GLenum GLESVertexAttribToEnum[];

enum class DummyItemType
{
    Plane,
    Triangle,
    Box,
    Sphere,
    Icosahedron,
};

typedef std::integral_constant<DummyItemType, DummyItemType::Plane> Plane_t;
typedef std::integral_constant<DummyItemType, DummyItemType::Triangle> Triangle_t;
typedef std::integral_constant<DummyItemType, DummyItemType::Box> Box_t;
typedef std::integral_constant<DummyItemType, DummyItemType::Sphere> Sphere_t;
typedef std::integral_constant<DummyItemType, DummyItemType::Icosahedron> Icosahedron_t;

#endif //ANDROIDGRAPHICSDEMOS_VERTEXATTRIB_H
